﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dt261.ViewModel
{
    class SettingPageEsViewModel : GalaSoft.MvvmLight.ViewModelBase
    {
        private string titleText;
        public SettingPageEsViewModel()
        {

         
        }

        public string HospitalTitleText {  get => GlobalData.HospitalTitleText; set{
                GlobalData.HospitalTitleText = value;
                RaisePropertyChanged(); } } 

        //public void ReadConfigTitleInfo()
        //{
        //    var basePath = Environment.CurrentDirectory;

        //    string cfgINI = System.IO.Path.Combine(basePath, "hospital.ini");

        //    if (File.Exists(cfgINI))
        //    {

        //        //FileStream wr= File.OpenRead(cfgINI);
        //        HospitalTitleText = File.ReadAllText(cfgINI, Encoding.UTF8);
        //        //IniFile ini = new IniFile(cfgINI);
        //        //TitleText = ini.IniReadValue("SET", "NAME");

        //        //  SkinName = ini.IniReadValue("Skin", "Skin");
        //        // ServerType = ini.IniReadValue("Server", "Bridge");
        //    }
        //    else
        //    {
        //        HospitalTitleText = "未设置医院名";
        //    }
        //}

        //public void SaveTitleInfo()
        //{
        //    var basePath = Environment.CurrentDirectory;

        //    string cfgINI = System.IO.Path.Combine(basePath, "hospital.ini");

        //    if (File.Exists(cfgINI))
        //    {
        //        File.Delete(cfgINI);
        //    }
        //    //IniFile ini = new IniFile(cfgINI);
        //    //ini.IniWriteValue("SET", "NAME", TitleText);
        //    File.WriteAllText(cfgINI, HospitalTitleText, Encoding.UTF8);

        //}
    }
}
